Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix : Enabling urls without http in front of them [STTNHUB-252] #42

Closed
wants to merge 5 commits into from

Conversation

devketanpro
Copy link
Member

No description provided.

)


def transform_link_from_text(item, fields):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have this code in superdesk-core (https://github.com/superdesk/superdesk-core/blob/develop/superdesk/text_utils.py#L193).

This is the code that is currently being used to transform plain text to rich text (for Editor3 fields).
Seems like the bug is there, and should be fixed there

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Okay, let me check. Thanks, Mark!

@@ -86,6 +104,20 @@ def parse(self, tree: Element, provider=None):
# If the item contains the ``sttinstruct:remove`` signal, no need to ingest this one
continue
self.set_extra_fields(item, tree)

fields = (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This functionality is already in EventsML parser from superdesk-planning. And we have to check if the field is using Editor3, otherwise adding HTML tags in plain text would not be ideal.

As we support this as a core feature, we should update the EventsML and PlanningML parsers to support all possible fields. See https://github.com/superdesk/superdesk-planning/blob/develop/server/planning/feed_parsers/events_ml.py#L252 for example.

We first check if the field is Editor3 in the content profile, and then attempt to convert to html. So it might be good to implement a utility in superdesk-planning to convert multiple fields on ingest to editor3, checking it's content profile.

@MarkLark86
Copy link
Contributor

@devketanpro Basically this PR can be closed, and a PR in superdesk-core and superdesk-planning so this can be supported as a core improvement & bug fix

@devketanpro devketanpro deleted the STTNHUB-252 branch October 20, 2023 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants